import { Button } from "@douyinfe/semi-ui";
import React, { useState } from "react";

interface MyButtonProps {
  count: number;
  onClick: () => void;
}
function MyButton({ count, onClick }: MyButtonProps) {
  return <Button onClick={onClick}>点击了{count}次</Button>;
}

const MyApp: React.FC = () => {
  const [count, setCount] = useState(0);

  const handleClick = () => {
    setCount(count + 1);
  };

  return (
    <>
      <MyButton count={count} onClick={handleClick} />
      &nbsp;
      <MyButton count={count} onClick={handleClick} />
    </>
  );
};

export default MyApp;
